import { HashRouter, BrowserRouter, Route, Routes, Navigate } from 'react-router-dom'
import React from 'react'
import Login from './pages/Login'
import Index from './pages/nav/index'
const Myhome = React.lazy(() => import("./pages/accounts/Myhome"))
const Myfrom = React.lazy(() => import("./pages/accounts/Myfrom"))
const Myuser = React.lazy(() => import("./pages/accounts/Myuser"))
const Adduser = React.lazy(() => import("./pages/accounts/Adduser"))
const Addfrom = React.lazy(() => import("./pages/accounts/Addfrom"))
function App() {
    return (
        <React.Suspense fallback={<div>加载中...</div>}>
            <HashRouter>
                <Routes>
                    <Route path='/' element={<Navigate to={"/login"} />} />
                    <Route path="/login" element={<Login />} />
                    <Route path="/nav" element={<Index />} >
                        <Route path="home" element={<Myhome />} />
                        <Route path="myfrom" element={<Myfrom />} />
                        <Route path="addfrom" element={<Addfrom />} />
                        <Route path="myuser" element={<Myuser />} />
                        <Route path="adduser" element={<Adduser />} />
                    </Route>
                </Routes>
            </HashRouter>
        </React.Suspense>
    )
}
export default App
